package com.eight.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.eight.order.dao.TeacherDao;
import com.eight.order.pojo.Teacher;
import com.eight.order.service.TeacherService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

/**
 * @program: qy8-education
 * @description:
 * @author: 郑友民（1460115388@qq.com）
 * @create: 2023-05-27 16:19
 **/
@Service
public class TeacherServiceImpl implements TeacherService {
    @Resource
    private TeacherDao teacherDao;

    @Override
    public Teacher queryAllTeacherByTeacherName(String teacherName) {
        QueryWrapper<Teacher> wrapper = new QueryWrapper<>();
        if (StringUtils.hasText(teacherName)){
            wrapper.eq("name",teacherName);
        }
        Teacher teacher = teacherDao.selectOne(wrapper);
        return teacher;
    }
}

